<template>
	<view>
		<view class="page">
		   <comp-common v-bind="{data:data}"></comp-common>
		    <comp-header v-bind="{data:data}"></comp-header>
		    <view class="body after-navber">
		        <view class="list">
		            <view class="item flex flex-row" v-for="(item,index) in data.list" :key="index">
		                <view class="flex-grow-1">
		                    <view v-if="item.status==0">待审核</view>
		                    <view style="color:#3fc24c;" v-else-if="item.status==1">已转账</view>
		                    <view style="color:#ff4544;" v-else>已拒绝</view>
		                    <view style="font-size: 9pt;color: #888;margin-top: 12upx">{{item.addtime}}</view>
		                </view>
		                <view class="flex-grow-0 flex-y-center" style="color: #ff4544;">{{item.money}}</view>
		            </view>
		        </view>
		        <view style="text-align: center;color: #888;font-size: 9pt;height: 74upx;line-height: 74upx" v-if="data.no_more">
		            没有记录了~
		        </view>
				<list-loading v-bind="{data:data}"></list-loading>
		    </view>
		    	<comp-footer v-bind="{data:data}"></comp-footer>
		</view>
		
	</view>
</template>

<script>var myVue = {};
import listLoading from '../../../components/list-loading/list-loading.vue'
	export default {
		components:{
			listLoading
		},
		data() {
			return {
				 data: {
				    list: [],
				    current_page: 0,
				    loading: !1,
				    no_more: !1
				},
			};
		},
		  onLoad: function(t) {myVue = this;
		    myVue.getApp.page.onLoad(this, t);
		    this.getList();
		},
		onReady: function() {
		    myVue.getApp.page.onReady(this);
		},
		onShow: function() {
		    myVue.getApp.page.onShow(this);
		},
		onHide: function() {
		    myVue.getApp.page.onHide(this);
		},
		onUnload: function() {
		    myVue.getApp.page.onUnload(this);
		},
		onPullDownRefresh: function() {},
		onReachBottom: function() {
		    this.getList();
		},
		methods:{
			    getList: function() {
			    var a = this;
			    if (!a.data.loading && !a.data.no_more) {
			        a.setData({
			            loading: !0
			        });
			        var e = a.data.current_page + 1;
			        a.getApp.request({
			            url: a.getApp.api.store.user.cash_log,
			            data: {
			                page: e,
			                year: "",
			                month: ""
			            },
			            success: function(t) {
			                0 == t.code && (t.data.list && t.data.list.length ? (a.data.list = a.data.list.concat(t.data.list), 
			                a.setData({
			                    list: a.data.list,
			                    current_page: e
			                })) : a.setData({
			                    no_more: !0
			                })), 1 == t.code && a.getApp.core.showModal({
			                    title: "提示",
			                    content: t.msg,
			                    showCancel: !1
			                });
			            },
			            complete: function(t) {
			                a.setData({
			                    loading: !1
			                });
			            }
			        });
			    }
			},
		}
	}
</script>

<style scoped>
.list {
    border-top: 1upx solid #e3e3e3;
    border-bottom: 1upx solid #e3e3e3;
}

.item {
    background: #fff;
    padding: 24upx;
    border-bottom: 1upx solid #eee;
}

.item:last-child {
    border-bottom: none;
}

.item>.flex-grow-0 {
    padding-left: 24upx;
    font-weight: bold;
    font-size: 15pt;
}
</style>
